package edu.sdjzu.exam.mapper.examSession;

import edu.sdjzu.exam.domain.examSession.EnvironmentLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EnvironmentLogMapper {

    @Insert("INSERT INTO Environment_Logs (session_id, student_id, screen_sharing, virtual_machine, multiple_monitors, " +
            "fullscreen_mode, network_speed, noise_level, face_detected, suggestions, log_time) " +
            "VALUES (#{sessionId}, #{studentId}, #{screenSharing}, #{virtualMachine}, #{multipleMonitors}, " +
            "#{fullscreenMode}, #{networkSpeed}, #{noiseLevel}, #{faceDetected}, #{suggestions}, #{logTime})")
    void insertEnvironmentLog(EnvironmentLog log);

    @Select("SELECT * FROM Environment_Logs WHERE session_id = #{sessionId}")
    List<EnvironmentLog> selectBySessionId(Long sessionId);
}
